package com.stropheware.droidDefense;

import java.util.ArrayList;

import android.util.Log;

public class Cell {
	
	public static final int BLANK = 0;
	public static final int TOWER = 1;
	public static final int RESERVED = 2;
	private static final String TAG = "Cell";
	
	public boolean isInPath;
	public boolean isTopEdge;
	public boolean isBottomEdge;
	
	public int row;
	public int column;
	private int sideLength;
	
	public int pxRow;
	public int pxColumn;
	
	public AbstractTower occupiedTower;
		
	/*
	 * represents whether cell is blank, has tower in it, etc.
	 */
	public int content;
	
	private GameBoard gameBoard;
	
	public Cell(int row, int column, int sideLength, GameBoard gameBoard, boolean isTopEdge, boolean isBottomEdge) {
		this.row = row;
		this.column = column;
		this.sideLength = sideLength;
		this.gameBoard = gameBoard;
		this.isTopEdge = isTopEdge;
		this.isBottomEdge = isBottomEdge;
		pxRow = row * sideLength + gameBoard.startYPixel;
		pxColumn = column * sideLength + gameBoard.startXPixel;
		content = BLANK;
		occupiedTower = null;
		isInPath = false;
	}
	
	public Cell(int content, int row, int column, int sideLength, GameBoard gameBoard, boolean isTopEdge, boolean isBottomEdge) {
		this(row, column, sideLength, gameBoard, isTopEdge, isBottomEdge);
		this.content = content;
	}
	
	public int getContent() {
		return content;
	}
	
	public int getRow() {
		return row;
	}
	
	public int getColumn() {
		return column;
	}
	
	public int getSideLength() {
		return sideLength;
	}
	
	public int getRowPixel() {
		return pxRow;
	}
	
	public int getColumnPixel() {
		return pxColumn;
	}
	public boolean equals(Object obj){
		if(obj instanceof Cell && this.row == ((Cell)obj).row && this.column==((Cell)obj).column)
			return true;
		else
			return false;
	}
}
